﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using UC_Framework;

namespace SwarmPlay
{
    class GameLevel_2 : GameLevel_1
    {
        public GameLevel_2()
        {

            // arrange obstacles

            int interval = 120;
            int[] x = new int[4];
            int[] y = new int[4];
            x[0] = 170;
            y[0] = 80;
            for (int i = 1; i < 4; i++)
            {
                x[i] = x[i - 1] + interval;
                y[i] = y[i - 1] + interval;
            }
            obstacles = new Rectangle[16];
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    obstacles[i*4 + j] = new Rectangle(x[j],y[i],90,90);
                }
            }

            //numSprites = 1;
        }


        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            gd.Clear(Color.Silver);
            spriteBatch.Begin();
            //s.draw(spriteBatch);

            foreach (Rectangle obstacle in obstacles)
            {
                LineBatch.drawFillRectangleBorder(spriteBatch, obstacle, Color.YellowGreen, 2);
            }
            
            sl.drawAll(spriteBatch);


            LineBatch.drawCross(spriteBatch, mouse_x, mouse_y, 4, Color.Black, Color.Black);
            LineBatch.drawCrossX(spriteBatch, swarmCenter.X, swarmCenter.Y, 4, Color.Brown, Color.Brown);
            LineBatch.drawCrossX(spriteBatch, swarmTarget.X, swarmTarget.Y, 4, Color.Gray, Color.Gray);

            LineBatch.drawCircle(spriteBatch, Color.Bisque, new Vector2(swarmCenter.X, swarmCenter.Y), swarmRadius, 30, 1);

            // sl.drawInfo(spriteBatch, Color.Black, Color.White); // comment in to see bounding boxes

            spriteBatch.End();
        }
    }
}
